﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NeonMika.Webserver.ClientLibrary
{
    public abstract class Pin : INotifyPropertyChanged
    {
        protected readonly int id;
        public int ID { get { return id; } }

        protected int value;
        public int Value
        {
            get { return value; }
            set
            {
                this.value = value;
                OnPropertyChanged("Value");
            }
        }
        protected Netduino netduino;

        public Pin(int id, Netduino netduino)
        {
            this.id = id;
            this.netduino = netduino;
        }

        protected void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        public event PropertyChangedEventHandler PropertyChanged;
    }
}
